<?php

class Workset_Form_Element_File extends Zend_Form_Element_File {

   	/**
     * @param  string $type
     * @return Zend_Loader_PluginLoader_Interface
     */
    function getPluginLoader($type)
    {
        $type = strtoupper($type);

        if ($type != parent::TRANSFER_ADAPTER) {
            return parent::getPluginLoader($type);
        } else {
			$loader = new Zend_Loader_PluginLoader(array(
                'Zend_File_Transfer_Adapter' => 'Zend/File/Transfer/Adapter/',
                'Workset_File_Transfer_Adapter' => 'Workset/File/Transfer/Adapter/',
            ));
            $this->setPluginLoader($loader, self::TRANSFER_ADAPTER);
		}

        return $this->_loaders[$type];
    }

	function getValue() {
		$params = $this->getTransferAdapter()->getFileInfo($this->getName());
		if (isset($params['name'])) {
			return $params['name'];
		}
		return null;
	}

}

?>